#include"stdafx.h"

char WLArchive::staticCharPool[1024] = {'\0'};

WLArchive& operator << (WLArchive& Ar, WLVector3& DestVector3 )
{
	Ar<<DestVector3.x<<DestVector3.y<<DestVector3.z;
	return Ar;
}
WLArchive& operator << (WLArchive& Ar, WLQuaternion& Quat )
{
	Ar<<Quat.x;
	Ar<<Quat.y;
	Ar<<Quat.z;
	Ar<<Quat.w;
	return Ar;
}
const char* WLArchive::ParseToken(char *Str)
{
	int PoolGuard = 0;
	if ( !Str )
		return NULL;
	while(*Str !='\0')
	{
		m_BufferRead++;
		if ( *Str == ' ' || *Str == ',' || *Str == '\n' ||  *Str == ']')
		{
			Str++;
			if ( PoolGuard == 0 )
			{
				continue;
			}
			else
			{
				staticCharPool[PoolGuard] = '\0';
				break;
			}
		}
		if ( *Str == '[' )
		{
			Str++;		
			continue;
		}
		staticCharPool[PoolGuard] = *Str;
		PoolGuard++;
		Str++;

	}
	return staticCharPool;
}